package com.ghp.common.utils.response;

/**
 * @author ghp
 * @title 响应状态码
 * @description
 */
public enum ResponseStatus {


    /**
     * 成功
     */
    SUCCESS(2000, "成功"),
    SUCCESS_NOT_EXISTS(2001, "请求资源不存在"),

    /**
     * 客户端出错
     * 备注: 错误的产生来自用户
     */
    CLIENT_ERROR(3000, "客户端错误"),
    CLIENT_PARAMS_ERROR(3001, "参数非法"),
    CLIENT_UNAUTHORIZED_ERROR(3002, "权限不足"),
    CLIENT_AUTHENTICATION_ERROR(3003, "权限认证失败"),
    CLIENT_NOT_FOUNT_ERROR(3004, "请求数据不存在"),
    CLIENT_ACCOUNT_ALREADY_EXIST(3005, "账号已存在"),
    CLIENT_USER_NOT_LOGIN(3006, "当前用户未登录"),
    CLIENT_USER_NOT_EXIST(3007, "账号或密码错误"),
    CLIENT_USER_LOGIN_TIMEOUT(3008, "登录超时请重新登录"),
    CLIENT_USER_REQUEST_TIMEOUT(3009, "请求超时"),

    /**
     * 系统出错
     * 备注: 错误的产生来自系统本身
     */
    SYSTEM_ERROR(4000, "系统执行出错"),
    SYSTEM_TIMEOUT_ERROR(4001, "系统执行超时"),

    /**
     * 第三方服务出错
     * 备注: 错误的产生来自第三方服务
     */
    SERVICE_ERROR(5000, "网络出现了问题"),
    SERVICE_INSERT_ERROR(5001, "新增失败"),
    SERVICE_DELETE_ERROR(5002, "删除失败"),
    SERVICE_UPDATE_ERROR(5003, "更新失败"),
    SERVICE_SELECT_ERROR(5004, "查询失败"),
    SERVICE_REDIS_ERROR(5005, "redis中的key已失效");

    /**
     * 状态码
     */
    private int code;

    /**
     * 错误信息
     */
    private String message;

    ResponseStatus(int code, String Message) {
        this.code = code;
        this.message = Message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
